package com.garbagecan.cachestudy.mycache.impl;

import com.opensymphony.oscache.general.GeneralCacheAdministrator;
import java.util.Map;
import com.garbagecan.cachestudy.mycache.CacheException;
import com.garbagecan.cachestudy.mycache.CacheManager;

public class CacheManagerOSCacheAdapter implements CacheManager {

	private GeneralCacheAdministrator cacheAdmin;
	
	public CacheManagerOSCacheAdapter() throws CacheException {
		this.cacheAdmin = new GeneralCacheAdministrator();
	}

	public void put(String name, Object obj) throws CacheException {
		try {
			cacheAdmin.putInCache(name, obj);
		} catch (Exception ex) {
			throw new CacheException(ex);
		}
	}

	public void put(String group, String name, Object obj)
				throws CacheException {
		try {
			cacheAdmin.putInCache(name, obj, new String[]{group});
		} catch (Exception ex) {
			throw new CacheException(ex);
		}
	}

	public void putAll(Map<String, Object> map) throws CacheException {
		
	}

	public void putAll(String group, Map<String, Object> map)
				throws CacheException {
		
	}

	public Object get(String name) throws CacheException {
		return null;
	}

	public Object get(String group, String name) throws CacheException {
		return null;
	}

	public Map<String, Object> getAll(String group) throws CacheException {
		return null;
	}

	public void remove(String name) throws CacheException {
		
	}

	public void remove(String group, String name) throws CacheException {
		
	}

	public void removeAll(String group) throws CacheException {
		
	}

	public void clear() throws CacheException {
		
	}
}
